BLOG

Have a Question? We have an answer!

Here are some of our FAQs. If you have any other questions you'd like answered please feel free to contact us.

Difference between local stoarage vs. global storage: there is no difference between the window.localStorage and localStorage the Window is the global object the window is the default prefix but the correct one is window.localStorage because the localStorage attribute is part of window object.

Differences between global scope vs. block scope: The Global scope A variable exists inside or outside a block. If a variable is declared outside all functions or curly braces ({}), it exists in the global scope. The global variables can be accessed by any line of code in the program, including inside blocks. A Global scope example The Local scope In contrast to global variables, locally scoped ones are only visible within the function they are declared. Each function written in JavaScript creates a new local scope and every variable declared in this scope is a local variable. That means that variables with the same name can be used in different functions. However, any effort to reference a local variable outside its scope will result in a Reference Error:

Working of the Event loop: When Node.js starts, it initializes the event loop, processes the provided input script which may make async API calls, schedule timers, then begins processing the event loop. In the previous example, the initial input script consisted of console.log () statements and a setTimeout () function which schedules a timer.

The short answer is that JavaScript interpreter returns undefined when accessing a variable or object property that is not yet initialized. For example: On the other side, null represents a missing object reference. JavaScript doesn’t initialize variables or object properties with null.

`